function Buff(config) {
	var me = this;
	var data;

	me.data = {
		currentLevel : 0,
		id : null,
		name : null,
		mod : null,
		amount : null,
		method : null,
		multPriority : null
	};
	
	me.Events = {
		'levelchanged' : []
	};
	
	me.data.id = config.id;
	me.data.name = config.name;
	me.data.mod = config.mod;
	me.data.amount = config.amount;
	me.data.method = config.method;
	if (config.method == 'mult') // multPriority obligatoire
		me.data.multPriority = config.multPriority;
}

Buff.prototype = new Event();

Object.defineProperty(Buff.prototype, "Amount", {
	get : function() {
		if (this.Level <= 0)
			return 0;
		return this.data.amount[this.Level - 1];
	}
});

Object.defineProperty(Buff.prototype, "Id", {
	get : function() {
		return this.data.id;
	}
});

Object.defineProperty(Buff.prototype, "Level", {
	get : function() {
		return this.data.currentLevel;
	},
	set : function(value) { // TODO faire la vérif
		this.data.currentLevel = parseInt(value);
		this.broadcast('levelchanged');
	}
});

Object.defineProperty(Buff.prototype, "Method", {
	get : function() {
		return this.data.method;
	}
});

Object.defineProperty(Buff.prototype, "Mod", {
	get : function() {
		return this.data.mod;
	}
});

Object.defineProperty(Buff.prototype, "Name", {
	get : function() {
		return this.data.name;
	}
});
